var config = require('../../../../../config');
var filter = require('../../../../../framework/filter');
var galleryController = require('./contrl');

exports = module.exports = function(server) {
    server.get(config.api_version  + 'galleryOpt/queryGalleryBySubId', filter.authorize, galleryController.queryGalleryBySubId);
    server.get(config.api_version  + 'gallery/:id', galleryController.galleryById);
    server.post(config.api_version  + 'gallery', galleryController.saveGallery);
    server.post(config.api_version  + 'gallery/:id', galleryController.updateGallery);
    server.delete(config.api_version  + 'gallery/:id', galleryController.deleteGallery);

    server.get(config.api_version  + 'pictureOpt/queryPictureByGalleryId', filter.authorize, galleryController.queryPictureByGalleryId);
    server.get(config.api_version  + 'picture/:id', galleryController.pictureById);
    server.post(config.api_version  + 'picture', galleryController.savePicture);
    server.post(config.api_version  + 'picture/:id', galleryController.updatePicture);
    server.delete(config.api_version  + 'picture/:id', galleryController.deletePicture);
};